#!/usr/bin/env python
import logging
from binance.um_futures import UMFutures
from binance.lib.utils import config_logging
from binance.error import ClientError

config_logging(logging, logging.DEBUG)

key = "M8dOBYKoB5t8PMFn96XmO3lk5qoTraVpXX2VVqWwHIWmA58HsfdPavqVtW2gz6DP"
secret = "aKg8XdKHbIsHNsU6CkmXQ6bSEWJQdF9upNTwNmkkfJlLaZ7nbGoGqve72uWLnEBf"

um_futures_client = UMFutures(key=key, secret=secret)

try:
    response = um_futures_client.balance(recvWindow=6000)
    for item in response:
        print(item)
    logging.info(response)
except ClientError as error:
    logging.error(
        "Found error. status: {}, error code: {}, error message: {}".format(
            error.status_code, error.error_code, error.error_message
        )
    )
